var
	search = window.location.search,
	match = search.match( /(?:[\?&]|&amp;)CKEditorFuncNum=([^&]+)/i ),
	type = search.match( /(?:[\?&]|&amp;)Type=([^&]+)/i ),
	CKEditorFuncNum = ( match && match.length > 1 ) ? match[ 1 ] : '',
	win = window.top.opener,
	$ = win.jSam.$,
	SetUrl = function( fileUrl ){
		win.CKEDITOR.tools.callFunction( CKEditorFuncNum, fileUrl );
		if( !type ){
			$( 'select.cke_dialog_ui_input_select:visible:has( option:contains("http://") )', win.document ).get( 0 ).selectedIndex = 4;
		}
		window.top.close();
	};